Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 7 - Finder Interface Reference / Finder Interface Functions
Manipulating Folder Descriptors /


AddFolderDescriptor

NEW WITH MAC OS 8

Copies the supplied information into a new folder descriptor entry in the system folder list.

pascal OSErr AddFolderDescriptor (
                     FolderType foldType,
                     FolderDescFlags flags,
                     FolderClass foldClass,
                     FolderLocation foldLocation,
                     OSType badgeSignature,
                     OSType badgeType,
                     ConstStr63Param name,
                     Boolean replaceFlag);
foldType
A constant identifying the type of the folder which you wish the Folder Manager to be able to find. See "Folder Type Constants".
flags
Set these flags to indicate whether a folder is created during startup, if the folder name is locked, and if the folder is created invisible; see "Folder Descriptor Flag Constants".
foldClass
The class, indicating whether the folder is relative to the parent folder or special, of the folder which you wish the Folder Manager to be able to find; see "Folder Descriptor Class Constants".
foldLocation
For a relative folder, specify the folder type of the parent folder of the target. For a special folder, specify the location of the folder; see "Folder Descriptor Location Constants".
badgeSignature
The OSType identifying the icon badge signature. Set to 0.
badgeType
The OSType identifying the icon badge type. Set to 0.
name
For a relative folder, specify the name of the target folder. For a special folder, the actual target folder may have a different name than the name specified in the folder descriptor. For example, the System Folder is often given a different name, but it can still be located with FindFolder.
replaceFlag
A Boolean value indicating whether you wish to replace a folder routing that already exists. This prevents the return code duplicateRoutingErr from being returned. If true, it replaces the folder to which the item is being routed. If false, it leaves the folder to which the item is being routed.
function result
A result code; see "Result Codes". The result code indicates that a folder descriptor is already installed with the specified folder type and replaceFlag is false.
DISCUSSION
The AddFolderDescriptor function copies the supplied information into a new descriptor entry in the system folder list. You need to provide folder descriptors for each folder you wish the Folder Manager to be able to find. For example, a child folder located in a parent folder needs to have a descriptor created both for it and its parent folder, so that the child can be found.

SPECIAL CONSIDERATIONS
Before calling the AddFolderDescriptor function, you must pass the selector gestaltFindFolderAttr to the Gestalt function. If the gestaltFolderDescSupport bit is set, AddFolderDescriptor is available.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998